/**
 * @type {Number}
 *
 * @properties={typeid:35,uuid:"26766EFF-3B31-4DA2-A35C-0B2F929BE9F6",variableType:4}
 */
var fTipoEnsayo = null;

/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"DF494D42-CCE2-4D47-85B2-EC90F5637849"}
 */
var fDescripcion = null;


/**
 * Handle changed data.
 *
 * @param {Number} oldValue old value
 * @param {Number} newValue new value
 * @param {JSEvent} event the event that triggered the action
 *
 * @returns {Boolean}
 *
 * @properties={typeid:24,uuid:"E3BF3DFB-E52C-4E29-891F-BECF35D2FEF1"}
 */
function onDataChange_tipo_resultado(oldValue, newValue, event) 
{
	if (tipo_resultado == scopes.globals.zconf_lista)
		elements.nombre_valuelist.enabled = true;
	else
		elements.nombre_valuelist.enabled = false;
	return true
}

/**
 * Handle record selected.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"1379B6B6-5308-4FD3-8503-EBE9D24FC342"}
 */
function onRecordSelection(event) 
{
	if (tipo_resultado == scopes.globals.zconf_lista)
		elements.nombre_valuelist.enabled = true;
	else
		elements.nombre_valuelist.enabled = false;
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"D163F3A5-FD23-4552-98A0-0CB51229A1C5"}
 */
function iraDtl(event) {
	globals.mostrarForm('ensayos_dtl')
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"0AE1787D-6DEB-4894-9BA9-43C85CB93F98"}
 */
function nuevoSubEnsayo(event) {

	databaseManager.setAutoSave(false)
	ensayos_to_subensayos.newRecord()
	forms.ensayos_carga.controller.loadRecords(ensayos_to_subensayos)
	globals.formEnVentana('ensayos_carga','ENSAYO_CARGA','Nuevo Ensayo')

}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"EB5377C5-8F0E-43D9-9C1A-5C158F7B264F"}
 */
function nuevoEnsayo(event) {

	databaseManager.setAutoSave(false)
	controller.newRecord()
	forms.ensayos_carga.controller.loadRecords(foundset)
	globals.formEnVentana('ensayos_carga','ENSAYO_CARGA','Nuevo Ensayo')
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"B8C3F872-BFAD-4BD8-A4F1-C862C0EDA88D"}
 * @AllowToRunInFind
 */
function buscar(event) {
	controller.find()
	
	descripcion 	= '%' + fDescripcion + '%'
	tipo_ensayo_id	= fTipoEnsayo
	
	controller.search()
}
